#!/usr/bin/env python3

def test_user_main():
    import datetime
    import json
    import os
    import sys

    if "peers_identity" not in sys.path:
        sys.path.insert(0, os.path.abspath("./src/peers_identity"))
    if "peers_identity" not in sys.path:
        sys.path.insert(0, os.path.abspath("../src/peers_identity"))

    from models.User import User, UserSchema, add_new_user, get_all_users

    user = User(username="Alice",pub_key=f"foo_{datetime.datetime.now()}")
    add_new_user(user)
    results = get_all_users()
    for foo in results:
        schema = UserSchema()
        print(schema.dump(foo))

if __name__ == "__main__":
    test_user_main()
